<template>
  <div v-if="isActiveAlive">
    <GlobalHeader></GlobalHeader>
    <nuxt/>
  </div>
</template>

<script type="es6">
  import GlobalHeader from '~/components/common/GlobalHeader.vue'

  export default {
    components: {
      GlobalHeader
    },
    provide() {
      return {
        reload: this.reload,
        globalLoad: this.globalLoad,
      };
    },
    data() {
      return {
        isActiveAlive: true,//页面是否显示
      }
    },
    methods: {
      reload(callback) {
        this.isActiveAlive = false;
        this.$nextTick(() => {
          this.isActiveAlive = false;
          window.scrollTo(0, 0);
          callback && callback();
        })
      },
    }
  }
</script>

<style lang="scss">

</style>
